package cn.fl.riskctrl.tddb.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.cmm.base.framework.exception.BaseException;
import cn.cmm.base.framework.utils.BaseLogUtils;
import cn.fl.framework.base.context.CurrentThreadContext;
import cn.fl.riskctrl.tddb.service.ITdModifyService;
import cn.fl.riskctrl.tddb.transform.TdApplyVOTransform;
import cn.fl.riskctrl.tddb.transform.TdHitRulesVOTransform;
import cn.fl.riskctrl.tddb.transform.TdPolicyHitRulesVOTransform;
import cn.fl.riskctrl.tddb.transform.TdPolicyVOTransform;
import cn.fl.riskctrl.tddb.transform.TddcsnApplyLVOTransform;
import cn.fl.riskctrl.tddb.transform.TddcsnApplyVOTransform;
import cn.fl.riskctrl.tddb.transform.TddcsnReportVOTransform;
import cn.fl.riskctrl.tddb.transform.TdmpApplyLVOTransform;
import cn.fl.riskctrl.tddb.transform.TdmpApplyVOTransform;
import cn.fl.riskctrl.tddb.transform.TdmpReportVOTransform;
import cn.fl.riskctrl.tddb.vo.TdApplyVO;
import cn.fl.riskctrl.tddb.vo.TdHitRulesVO;
import cn.fl.riskctrl.tddb.vo.TdPolicyHitRulesVO;
import cn.fl.riskctrl.tddb.vo.TdPolicyVO;
import cn.fl.riskctrl.tddb.vo.TddcsnApplyLVO;
import cn.fl.riskctrl.tddb.vo.TddcsnApplyVO;
import cn.fl.riskctrl.tddb.vo.TddcsnReportVO;
import cn.fl.riskctrl.tddb.vo.TdmpApplyLVO;
import cn.fl.riskctrl.tddb.vo.TdmpApplyVO;
import cn.fl.riskctrl.tddb.vo.TdmpReportVO;
import fl.riskctrl.facade.tddb.api.ITddbModifyApiService;

/**
 * @Description: 同盾-策略集合信息

 客户端服务层接口实现
 * @Description: 业务层方法名称前缀：新增：add* 删除：remove* 修改：modify* 查询对象：select* get* 批量：batch* 查询集合：search*
 */
@Service
public class TdModifyServiceImpl implements ITdModifyService {

	

	/**
	 * 日志
	 */
	private static final Logger logger = LoggerFactory.getLogger(TdModifyServiceImpl.class);
	@Autowired
	private ITddbModifyApiService tddbModifyApiService;
	@Override
	public Boolean modifyTdApply(TdApplyVO vo) throws BaseException {
		if (vo == null) {
			BaseLogUtils.info(logger, "modifyTdApply", "修改对象参数不能为空!", CurrentThreadContext.getCurrentUserName());
			return false;
		}
		return tddbModifyApiService.modifyTdApply(TdApplyVOTransform.toDTO(vo));
	}

	@Override
	public Boolean modifyTddcsnApply(TddcsnApplyVO vo) throws BaseException {
		if (vo == null) {
			BaseLogUtils.info(logger, "modifyTddcsnApply", "修改对象参数不能为空!", CurrentThreadContext.getCurrentUserName());
			return false;
		}
		return tddbModifyApiService.modifyTddcsnApply(TddcsnApplyVOTransform.toDTO(vo));
	}

	@Override
	public Boolean modifyTddcsnApplyL(TddcsnApplyLVO vo) throws BaseException {
		if (vo == null) {
			BaseLogUtils.info(logger, "modifyTddcsnApplyL", "修改对象参数不能为空!", CurrentThreadContext.getCurrentUserName());
			return false;
		}
		return tddbModifyApiService.modifyTddcsnApplyL(TddcsnApplyLVOTransform.toDTO(vo));
	}

	@Override
	public Boolean modifyTddcsnReport(TddcsnReportVO vo) throws BaseException {
		if (vo == null) {
			BaseLogUtils.info(logger, "modifyTddcsnReport", "修改对象参数不能为空!", CurrentThreadContext.getCurrentUserName());
			return false;
		}
		return tddbModifyApiService.modifyTddcsnReport(TddcsnReportVOTransform.toDTO(vo));
	}

	@Override
	public Boolean modifyTdmpApply(TdmpApplyVO vo) throws BaseException {
		if (vo == null) {
			BaseLogUtils.info(logger, "modifyXjnpAccFund", "修改对象参数不能为空!", CurrentThreadContext.getCurrentUserName());
			return false;
		}
		return tddbModifyApiService.modifyTdmpApply(TdmpApplyVOTransform.toDTO(vo));
	}

	@Override
	public Boolean modifyTdmpApplyL(TdmpApplyLVO vo) throws BaseException {
		if (vo == null) {
			BaseLogUtils.info(logger, "modifyXjnpAccFund", "修改对象参数不能为空!", CurrentThreadContext.getCurrentUserName());
			return false;
		}
		return tddbModifyApiService.modifyTdmpApplyL(TdmpApplyLVOTransform.toDTO(vo));
	}

	@Override
	public Boolean modifyTdmpReport(TdmpReportVO vo) throws BaseException {
		if (vo == null) {
			BaseLogUtils.info(logger, "modifyTdmpReport", "修改对象参数不能为空!", CurrentThreadContext.getCurrentUserName());
			return false;
		}
		return tddbModifyApiService.modifyTdmpReport(TdmpReportVOTransform.toDTO(vo));
	}

	@Override
	public Boolean modifyTdPolicy(TdPolicyVO vo) throws BaseException {
		if (vo == null) {
			BaseLogUtils.info(logger, "modifyTdPolicy", "修改对象参数不能为空!", CurrentThreadContext.getCurrentUserName());
			return false;
		}
		return tddbModifyApiService.modifyTdPolicy(TdPolicyVOTransform.toDTO(vo));
	}

	@Override
	public Boolean modifyTdPolicyHitRules(TdPolicyHitRulesVO vo) throws BaseException {
		if (vo == null) {
			BaseLogUtils.info(logger, "modifyTdPolicyHitRules", "修改对象参数不能为空!", CurrentThreadContext.getCurrentUserName());
			return false;
		}
		return tddbModifyApiService.modifyTdPolicyHitRules(TdPolicyHitRulesVOTransform.toDTO(vo));
	}

	@Override
	public Boolean modifyTdHitRules(TdHitRulesVO vo) throws BaseException {
		if (vo == null) {
			BaseLogUtils.info(logger, "modifyTdHitRules", "修改对象参数不能为空!", CurrentThreadContext.getCurrentUserName());
			return false;
		}
		return tddbModifyApiService.modifyTdHitRules(TdHitRulesVOTransform.toDTO(vo));
	}
	
	
}
